package com.liuyk.util;

import android.content.Context;
import android.content.Intent;

import com.liuyk.activity.MainActivity;

/**
 * Intent Util
 * <p>
 * Created by Administrator on 2015/11/16.
 */
public class IntentUtil {

    public static void goToAppHome(Context context) {
        final Intent intent = new Intent(context, MainActivity.class);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(intent);
    }

    //退到桌面
    public static void goToHome(Context context) {
        final Intent intent = new Intent(Intent.ACTION_MAIN);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        intent.addCategory(Intent.CATEGORY_HOME);
        context.startActivity(intent);
    }
}
